package com.changjiang.luban.service.sys;

import com.changjiang.luban.dao.sys.LogDao;
import com.changjiang.luban.dao.domain.sys.SysLog;
import com.changjiang.luban.utils.data.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * LogServiceImpl
 * Description:
 *
 * @author tengchenglong
 * @version v0.1
 * @date 2018/6/19-10:58
 */
@Service
@SuppressWarnings("ALL")
public class LogServiceImpl implements LogServiceI {

    @Autowired
    private LogDao logDao;

    @Override
    public boolean saveLog(SysLog log) {
        return logDao.saveEntity(log);
    }

    @Override
    public Page<SysLog> pageList(Page page) {
        String sql = " select * from sys_log where 1=1  order by create_time desc";
        return logDao.page(sql,page,SysLog.class);
    }

    @Override
    public boolean delete(Integer type) {
        if (logDao.deleteByType(type)>0){
            return true;
        }
        return false;
    }


}
